import http from "@/network/http";
import { TreasuryPrize } from "@/types";

export type TreasuryPrizeCreateParams = Omit<TreasuryPrize, 'treasuryPrizeId' | 'createUserId' | 'createUserName'>;

export const createTreasuryPrize = (params: TreasuryPrizeCreateParams) => {
  return http.post({
    url: '/treasury/prize/create',
    data: params
  });
}

export const getTreasuryPrizeDetail = (treasuryPrizeId: number): Promise<TreasuryPrize> => {
  return http.get({
    url: '/treasury/prize/detail',
    data: { treasuryPrizeId }
  });
}

export const joinTreasuryPrize = (treasuryPrizeId: number) => {
  return http.post({
    url: '/treasury/prize/join',
    data: { treasuryPrizeId }
  });
}

